import SettingPanel, { SettingPanelType } from "./SettingPanel";
import GameManager, { GameType } from "../Manager/GameManager";
import TipPanel from "./TipPanel";
import UIManager from "../Manager/UIManager";


const {ccclass, property} = cc._decorator;

@ccclass
export default class WXSubContextViewPanel extends cc.Component {
    public static Instance:WXSubContextViewPanel;

    @property(cc.Node)
    rankControl:cc.Node = null;


    @property(cc.Button)
    Button_rank_close:cc.Button = null;

    @property(cc.Button)
    Button_rank_pre:cc.Button = null;
    @property(cc.Button)
    Button_rank_next:cc.Button = null;


    onLoad () {
        WXSubContextViewPanel.Instance = this;
    }

    start () {
        // if (cc.sys.platform == cc.sys.WECHAT_GAME) {
        //     // 关闭排行榜
        //     this.Button_rank_close.node.on('click', ()=>{
        //         // UIManager.Instance.wxSubContextView.node.active = false;

        //         WXSubContextViewPanel.Instance.rankControl.active = false;
        //         wx.getOpenDataContext().postMessage({
        //             msg: 'closeRank'
        //         });
        //     }, this);

        //     // 上一页排行榜
        //     this.Button_rank_pre.node.on('click', ()=>{
        //         wx.getOpenDataContext().postMessage({
        //             msg: 'Button_rank_pre'
        //         });
        //     }, this);

        //     // 下一页排行榜
        //     this.Button_rank_next.node.on('click', ()=>{
        //         wx.getOpenDataContext().postMessage({
        //             msg: 'Button_rank_next'
        //         });
        //     }, this);
        // }
    }

    ShowOn()
    {
        this.node.active = true;
    }

    ShowOff()
    {
        this.node.active = false;
    }

}
